﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace JX.Infrastructure.Framework.Jwt
{
	/// <summary>
	/// jwt配置，在appsettings.json文件中
	/// </summary>
	public class JwtConfig
	{
		/// <summary>
		/// 发布人
		/// </summary>
		[DisplayFormat(ConvertEmptyStringToNull = false)]
		public string Issuer { get; set; } = string.Empty;

		/// <summary>
		/// 订阅人
		/// </summary>
		[DisplayFormat(ConvertEmptyStringToNull = false)]
		public string Audience { get; set; } = string.Empty;

		/// <summary>
		/// 自定义密钥
		/// </summary>
		[DisplayFormat(ConvertEmptyStringToNull = false)]
		public string Secret { get; set; } = string.Empty;

		/// <summary>
		/// AccessToken有效时间，单位：分钟
		/// </summary>
		public int Lifetime { get; set; } = 15;

		/// <summary>
		/// RefreshToken有效时间，单位：分钟
		/// </summary>
		public int RefLifetime { get; set; } = 30;
	}
}
